<template>
	<view class="parent-view">
		<view class="list-item" style="margin-top: 20rpx;">
			<text class="item-title">修改拾亲号-</text>
			<text class="item-desc">{{userData.username}}</text>
			<text class="item-time">{{happenTimeFun(userData.sqmarktime)}}</text>
		</view>
		<view style="width: 100%;height: 2rpx;"></view>
		<view class="list-item">
			<text class="item-title">注册拾亲号-</text>
			<text class="item-desc">{{userData.inisqmark}}</text>
			<text class="item-time">{{happenTimeFun(userData.activate_time)}}</text>
		</view>
	</view>
</template>

<script>
	import request from '../index/request.js';
	export default {
		data() {
			return {
				userData:{}
			}
		},
		methods: {
			onLoad: function(options) {
				this.appUtil.saveAppInviteId(options)
				this.getUserInfo()
			},
			onShow:function(){
				this.share.url='/pages/tabBar/home/index?appInviteId='+this.appUtil.getAppInviteId()
				this.share.shareType=1
			},
			getUserInfo: function() {
				var that = this
				var user=uni.getStorageSync("shiqin-user")
				request.post("api/common/PQD_data", {
					target_flag: user.PQD
				}).then(data => {
					that.userData = data
				})
			},
			happenTimeFun:function(num){//时间戳数据处理
				let date = new Date(num*1000);
				//时间戳为10位需*1000，时间戳为13位的话不需乘1000
		        let y = date.getFullYear();
		        let MM = date.getMonth() + 1;
		        MM = MM < 10 ? ('0' + MM) : MM;//月补0
		        let d = date.getDate();
		        d = d < 10 ? ('0' + d) : d;//天补0
		        let h = date.getHours();
		        h = h < 10 ? ('0' + h) : h;//小时补0
		        let m = date.getMinutes();
		        m = m < 10 ? ('0' + m) : m;//分钟补0
		        let s = date.getSeconds();
		        s = s < 10 ? ('0' + s) : s;//秒补0
		        return y + '年' + MM + '月' + d +'日'
				// return y + '-' + MM + '-' + d + ' ' + h + ':' + m+ ':' + s;
			},
		}
	}
</script>

<style>
	@import "index.css";
</style>
